package cn.wolfcode.cloud.shop.util;


import org.apache.commons.codec.digest.DigestUtils;
import sun.security.util.Password;

import java.util.UUID;

/**
 * @Description: 密码加密工具类
 * @Author: 伍家钰
 * @Date: 2020/9/6 13:49
 * @Version: 1.0
 */
public class MD5Util {
    // 密码加密
    public static String encodCry(String salt, String password) {
        String pass = "" + salt.charAt(0) + salt.charAt(1) + password + salt.charAt(3) + salt.charAt(2);
        return DigestUtils.md5Hex(pass);
    }

    // 测试加密效果
   /* public static void main(String[] args) {
        String salt = UUID.randomUUID().toString().replace("-", "").substring(0, 6);
        System.out.println(salt);
        String p = MD5Util.encodCry(salt, "111111");
        System.out.println(p);
    }*/
}
